import sys

sys.path.insert(0, '../')

# 加载django配置文件，注册应用
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meiduo_mall.settings.dev")
django.setup()

from celery_tasks.html.tasks import generate_static_sku_detail_html
from goods.models import SKU

if __name__ == '__main__':
    """批量生成商品静态页"""
    skus = SKU.objects.all()
    for sku in skus:
        generate_static_sku_detail_html(sku.id)